﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LifeTree.Core.DataAccess;
using LifeTree.DomainModel.Repositories;

namespace LifeTree.Mvc.Tests.Fakes
{
    internal class UnitOfWorkFake : IUnitOfWork
    {
        private readonly ITaskRepository taskRepository;
        private readonly IWorkbookRepository workbookRepository;

        public UnitOfWorkFake()
        {
            this.taskRepository = new TaskRepositoryFake();
            this.workbookRepository = new WorkbookRepositoryFake();
        }

        public ITaskRepository TaskRepository
        {
            get { return this.taskRepository; }
        }

        public IWorkbookRepository WorkbookRepository
        {
            get { return this.workbookRepository; }
        }

        public bool SaveChangesCalled { get; private set; }

        public void SaveChanges()
        {
            this.SaveChangesCalled = true;
        }

        public void Dispose()
        {

        }
    }
}
